﻿


using HBase;
using HBase.db;
using hCommand;
using Net.http;
using System;
using System.Collections.Generic; 

namespace Persistence
{
    public class PkCSAuto: GkTransaction {
        public long pkId;
        public WhDopk pk;

        protected override TransRes Execute() {
            
            pk =getById<WhDopk>(pkId);
            String detSql = @"update  core_stock s  join core_stock_det d  on s.id=d.pId  join Wh_Dopk_det  p on d.item_Id=p.item_Id  
                    set s.pk_id=p.pid,s.pk_time=sgj_get_sys_now   where  d.status={0} and s.status ={1} and p.pid=@id";
            exec(HUtil.s(detSql,  StockDetailStatus.库存, StockStatus.空闲), pk); 
            pk.status = 2;
            update(pk, x => new { x.status });
            return new TransRes();
        }

       
  

        
    }
}
